<?php
// +----------------------------------------------------------------------
// | YFCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2016 http://www.rainfer.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: rainfer <81818832@qq.com>
// +----------------------------------------------------------------------
namespace app\admin\controller;

use think\Db;
use think\Cache;
use think\helper\Time;
use app\admin\model\News as NewsModel;
use app\admin\model\MemberList;

class Index extends Base
{
    /**
     * 后台首页
     */
    public function index()
    {
        $this->redirect('admin/Organize/index');
    }
    
    /**
     * 后台多语言切换
     */
    public function lang()
    {
        if (!request()->isAjax()){
            $this->error('提交方式不正确');
        }else{
            $lang=input('lang_s');
            session('login_http_referer',$_SERVER["HTTP_REFERER"]);
            switch ($lang) {
                case 'cn':
                    cookie('think_var', 'zh-cn');
                break;
                case 'en':
                    cookie('think_var', 'en-us');
                break;
                //其它语言
                default:
                    cookie('think_var', 'zh-cn');
            }
            Cache::clear();
            $this->success('切换成功',session('login_http_referer'));
        }
    }
}